package com.zz.parkingsystem.entity;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 系统登录日志
 * @TableName t_system_login
 */
@Data
public class SystemLogin implements Serializable {
    /**
     * 系统登录日志编号
     */
    private Integer slId;

    /**
     * 登录者
     */
    private String slLoginUser;

    /**
     * 登录时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date slLoginTime;

    /**
     * 登录ip
     */
    private String slIp;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SystemLogin other = (SystemLogin) that;
        return (this.getSlId() == null ? other.getSlId() == null : this.getSlId().equals(other.getSlId()))
            && (this.getSlLoginUser() == null ? other.getSlLoginUser() == null : this.getSlLoginUser().equals(other.getSlLoginUser()))
            && (this.getSlLoginTime() == null ? other.getSlLoginTime() == null : this.getSlLoginTime().equals(other.getSlLoginTime()))
            && (this.getSlIp() == null ? other.getSlIp() == null : this.getSlIp().equals(other.getSlIp()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSlId() == null) ? 0 : getSlId().hashCode());
        result = prime * result + ((getSlLoginUser() == null) ? 0 : getSlLoginUser().hashCode());
        result = prime * result + ((getSlLoginTime() == null) ? 0 : getSlLoginTime().hashCode());
        result = prime * result + ((getSlIp() == null) ? 0 : getSlIp().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", slId=").append(slId);
        sb.append(", slLoginUser=").append(slLoginUser);
        sb.append(", slLoginTime=").append(slLoginTime);
        sb.append(", slIp=").append(slIp);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}